CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

INCLUDE(${PROJECT_SOURCE_DIR}/CMakeCommon)

INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ananas)

AUX_SOURCE_DIRECTORY(. ANANAS_SRC)
AUX_SOURCE_DIRECTORY(./log ANANAS_SRC)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
    REMOVE(${ANANAS_SRC} Kqueue.cc Kqueue.h)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    REMOVE(${ANANAS_SRC} Epoller.cc Epoller.h)
ENDIF()


ADD_LIBRARY(ananas ${ANANAS_SRC})
TARGET_LINK_LIBRARIES(ananas; pthread)
SET_TARGET_PROPERTIES(ananas PROPERTIES LINKER_LANGUAGE CXX)
